<script setup>
import { RouterView } from 'vue-router'
import { useRoute } from 'vue-router';
const route = useRoute()
console.log('route.fullpath', route)
// 登录
const handleLogin = () => {
  window.location = 'http://localhost:8008/#/login'
}
</script>
<template>
  <el-menu :default-active="route.fullPath" class="el-menu" mode="horizontal" :router="true">
    <el-menu-item index="/">首页
    </el-menu-item>
    <el-menu-item index="/news">新闻中心
    </el-menu-item>
    <el-menu-item index="/product">产品与服务
    </el-menu-item>
    <el-menu-item index="" @click="handleLogin">登录
    </el-menu-item>
  </el-menu>
  <div class="name">企业门户网站</div>
  <RouterView />
</template>

<style scoped>
.el-menu {
  width: 100%;
  position: sticky;
  top: 0px;
}

.name {
  position: absolute;
  top: 15px;
  right: 20px;
}
</style>
